package com.csy.ocmis.controller;


import com.csy.ocmis.entity.Doctor;
import com.csy.ocmis.entity.ReportVo;
import com.csy.ocmis.service.IDoctorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Calendar;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author csy
 * @since 2020-11-29
 */
@RestController
@RequestMapping("/doctor")
public class DoctorController {
    @Autowired
    private IDoctorService doctorService;
    //查询医生信息
    @RequestMapping("seldoctor")
    @ResponseBody
    public Object seldoctor(Doctor cDoctor){
        Calendar calendar = Calendar.getInstance();
        Integer data=calendar.get(Calendar.DAY_OF_WEEK)-1;//获取当前是星期几
        if(data==1){
            List<ReportVo> one = doctorService.one(cDoctor);
            return one;
        }else if(data==2){
            List<ReportVo> two = doctorService.two(cDoctor);
            return two;
        }else if(data==3){
            List<ReportVo> three = doctorService.three(cDoctor);
            return three;
        }else if(data==4){
            List<ReportVo> four = doctorService.four(cDoctor);
            return four;
        }else if(data==5){
            List<ReportVo> five = doctorService.five(cDoctor);
            return five;
        }else if(data==6){
            List<ReportVo> six = doctorService.six(cDoctor);
            return six;
        }else{
            List<ReportVo> seven = doctorService.seven(cDoctor);
            return seven;
        }
    }
}

